﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace littleAdminHelper
{
    class PathConversion
    {
        public static String encodepath(String path)
        {
            String output;
            
            if (path.StartsWith(".\\"))
            {
                output = Application.StartupPath.ToString();
                output += "\\" + ConfigurationManager.AppSettings.Get("logopath").Substring(2);
                return output;
            }
            else
            {
                return path;
            }

        }
        public static String decodepath(String path)
        {
            
            if (path.Contains(Application.StartupPath.ToString()))
            {
                 String relativepath=".";
                 relativepath += path.Substring(Application.StartupPath.ToString().Length);
                 return relativepath;
            }
            else
            {
                return path;
            }
        }

    }
}
